package com.itbaizhan.paymentdemo.controller;

import com.itbaizhan.paymentdemo.controller.dto.OrderInfoDTO;
import com.itbaizhan.paymentdemo.entity.OrderInfo;
import com.itbaizhan.paymentdemo.service.IOrderInfoService;
import com.itbaizhan.paymentdemo.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author itbaizhan
 * @since 04-26
 */
@RestController
@RequestMapping("/api/order")
public class OrderInfoController {

    @Autowired
    private IOrderInfoService iOrderInfoService;//订单接口
    /*创建订单*/
    @PostMapping("/createOrder")
    public BaseResult createOrder(OrderInfoDTO orderInfoDTO){

        OrderInfo order = iOrderInfoService.createOrder(orderInfoDTO);
        return BaseResult.ok(order);

    }

}
